package databases;
////116 tutorial.
////http://www.youtube.com/watch?NR=1&v=WKf5CvuQwAQ
////
//
//package bookless.pakage;
//
//import android.content.Context;
//import android.database.sqlite.SQLiteDatabase;
//import android.database.sqlite.SQLiteOpenHelper;
//
//public class DBstorage {
//
//	public static final String KEY_ROWID = "_id";
//	public static final String KEY_NAME = "user_name";
//	public static final String KEY_PASSWORD = "user_password";
//	
//	private static final String DATABASE_NAME = "userDB";
//	private static final String DATABASE_TABLE = "userTable";
//	private static final int DATABASE_VERSION = 1;
//	
//	private DbHelper ourHelper;
//	private final Context ourContext;
//	private SQLiteDatabase ourDatabase;
//	
//	private static class DbHelper extends SQLiteOpenHelper{
//		
//		public DbHelper(Context context){
//			super(context, DATABASE_NAME, null, DATABASE_VERSION);
//		}
//
//		// this method creates our database! this is only called once.
//		@Override
//		public void onCreate(SQLiteDatabase db) {
//			// TODO Auto-generated method stub
//			//creating the database table. specifying the table name and different variables in the table.
//			db.execSQL("CREATE TABLE" + DATABASE_TABLE + " (" + KEY_ROWID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
//					KEY_NAME + " TEXT NOT NULL, " + KEY_PASSWORD + " TEXT NOT NULL);"
//			);
//		}
//		
//		//if oncreate() is called, onupgrade() is called instead.
//		@Override
//		public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
//			// TODO Auto-generated method stub
//			db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE);
//			onCreate(db);	
//			
//		}
//		
//		
//	}
//	public DBstorage(Context c){
//		ourContext = c;
//	}
//	public DBstorage open(){
//		ourHelper = new DbHelper(ourContext);
//		ourDatabase = ourHelper.getWritableDatabase();
//		return this;
//	}
//	//closes SQLiteOpenHelper
//	public void close(){
//		ourHelper.close();
//	}
//	
//}
//
